<?php
//短信

namespace app\common\business;


use app\common\lib\Alisms;
use app\common\lib\Bdsms;
use app\common\lib\ClassArr;
use app\common\lib\Djsms;

class Sms
{
    //工厂模式
    static public function sms($tel, $type, $param, $needInstance = false)
    {
        $sms_type = ClassArr::smsClassStat();
        $sms_obj = ClassArr::initClass($type, $sms_type, $param, $needInstance);
        $sms = $needInstance ? $sms_obj->sms() : $sms_obj::sms();
        $sms && cache('sms_'.$tel,$sms,60);
        return $sms;
    }


}